import {createThunkAction} from "../../lib/redux-utils";
import {get} from "../../lib/http";

const path = "/home";
const ACTION_PREFIX = "DASHBOARD.";

export const dashboard = createThunkAction(ACTION_PREFIX + "DASHBOARD", () =>
    get(path + "/dashboard")
);
export const noteList = createThunkAction(ACTION_PREFIX + "NOTE_LIST", params =>
    get("/notes/getMyNotes/" + params.userId + "/" + params.orgId)
);
export const containerOrderList = createThunkAction(ACTION_PREFIX + "CONTAINER_ORDER", params =>
    get("/containerOrder/getUnReturnList/" + params.userId + "/" + params.orgId)
);

export const queryNotice = createThunkAction(ACTION_PREFIX + "NOTICE_LIST", params =>
    get("/notice/getTodayNotice/" + params)
);
export const fixNote = createThunkAction(ACTION_PREFIX + "FIX_NOTE", params =>
    get("/notes/fix/" + params)
);
export const delNote = createThunkAction(ACTION_PREFIX + "DEL_NOTE", params =>
    get("/notes/del/" + params)
);
export const generateDayFee = createThunkAction(ACTION_PREFIX + "GENERATE_DAY_FEE", () =>
    get(path + "/generateDayFee")
);
export const monthOrderCount = createThunkAction(ACTION_PREFIX + "MONTH_ORDER_COUNT", () =>
    get(path + "/monthOrderCount")
);

export const todayOrderCountAndMoney = createThunkAction(ACTION_PREFIX + "TODAYORDERCOUNTANDMONEY", params =>
    get(path + "/todayOrderCountAndMoney/" + params.userId + "/" + params.orgId)
);
export const thisMonthOrderCountAndMoney = createThunkAction(ACTION_PREFIX + "THISMONTHORDERCOUNTANDMONEY", params =>
    get(path + "/thisMonthOrderCountAndMoney/" + params.userId + "/" + params.orgId)
);
export const countByBusinessType = createThunkAction(ACTION_PREFIX + "COUNTBYBUSINESSTYPE", () =>
    get(path + "/countByBusinessType")
);
export const countByOriginPlace = createThunkAction(ACTION_PREFIX + "COUNTBYORIGINPLACE", () =>
    get(path + "/countByOriginPlace")
);
export const lastMonthOrderCountAndAmount = createThunkAction(ACTION_PREFIX + "LASTMONTHORDERCOUNTANDAMOUNT", params =>
    get(path + "/lastMonthOrderCountAndAmount/" + params.userId + "/" + params.orgId)
);
export const getOrderExpiredList = createThunkAction(ACTION_PREFIX + "GETORDEREXPIREDLIST", params =>
    get(path + "/getOrderExpiredList/" + params.userId + "/" + params.orgId)
);
export const getContainerOrderExpiredList = createThunkAction(ACTION_PREFIX + "GETCONTAINERORDEREXPIREDLIST", params =>
    get(path + "/getContainerOrderExpiredList/" + params.userId + "/" + params.orgId)
);
export const getOrderNoCompletedList = createThunkAction(ACTION_PREFIX + "GETORDERNOCOMPLETEDLIST", params =>
    get(path + "/getOrderNoCompletedList/" + params.userId + "/" + params.orgId)
);
export const getContractExpireList = createThunkAction(ACTION_PREFIX + "GETCONTRACTEXPIRELIST", params =>
    get(path + "/getContractExpireList/" + params.userId + "/" + params.orgId)
);
export const countByName = createThunkAction(ACTION_PREFIX + "COUNTBYNAME", () =>
    get(path + "/countByName")
);
export const daiBanShiXiangData = createThunkAction(ACTION_PREFIX + "DAIBANSHIXIANGDATA", params =>
    get(path + "/daiBanShiXiangData/" + params.userId + "/" + params.orgId)
);
export const getLog = createThunkAction(ACTION_PREFIX + "LOG_LIST", params =>
    get("/log/userLog/" + params.userId + "/" + params.orgId)
);
export const organizations = createThunkAction(ACTION_PREFIX + "ORGANIZATIONS", params =>
    get("/organization/tree/" + params)
);
export const getClientList = createThunkAction(ACTION_PREFIX + "GET_CLIENT", params =>
    get("/client/queryByOrgId/" + params)
);
export const getCarrierList = createThunkAction(ACTION_PREFIX + "GET_CARRIER", params =>
    get("/carrier/queryByOrgId/" + params)
);






